Unified interface for model mapping#177
Merged
VEZY merged 5 commits intoFeb 15, 2026
Merged
Conversation
…e for ModelList (TODO: make it work!!)
…es + are able to use it as a ModelList
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementing #120
Deprecating ModelList in favor of ModelMapping.
Deprecating the use of a Dict for model mapping in favor of ModelMapping.
ModelMapping is now the unique interface users face for declaring models.
At the time the single-scale pathway creates a ModelList, so we re-use all previous code. The multiscale pathway re-uses the previous Dict one.
This PR is not about reducing the pathways to one, but future work should do that, i.e. one way for computing the dependency graph, making all checks, etc, whatever the scale (single- or multi-). The only major difference I think is that ModelList can pre-allocate its outputs because their length is fixed. This would require some rework in the multirate setup, though (see below).
For now multirate is not handled in ModelList, but we should make a multiscale setup from the ModelList in this case (as a shortcut) before implementing something more clever that may pre-allocate outputs.
To do:
ModelMappingfor user-facing code (e.g. doc and tests), andModelMapping{SingleScale}when possible in the source code, orModelListotherwise.ModelMapping{SingleScale}: should either pre-allocate properly (involving) or at least fall back to the multiscale approach. In the latter case, handle the case where we don't provide the MTG (no MTG in single-scale setup)